﻿@model IEnumerable<DietPlanning.Models.Food>

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_LayoutAdmin.cshtml";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th>
            FoodTypeID
        </th>
        <th>
            FoodName
        </th>
        <th>
            ImageURL
        </th>
        <th>
            Calorie
        </th>
        <th>
            Carb
        </th>
        <th>
            Protein
        </th>
        <th>
            Fat
        </th>
        <th>
            Amount
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.FoodTypeID)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.FoodName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ImageURL)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Calorie)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Carb)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Protein)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Fat)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Amount)
        </td>
              <td>
            @Html.DisplayFor(modelItem => item.FoodType.FoodTypeName)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.FoodID }) |
            @Html.ActionLink("Details", "Details", new { id=item.FoodID }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.FoodID })
        </td>
    </tr>
}

</table>
